<?php
echo $javascript->link(array(
    'prototype', 'jquery-1.4.2', 'jquery.js',
    'date.js', 'jquery.datePicker.js', 'cake.datePicker.js'
        ), false);
echo $this->Html->css(array('addStaff', 'datePicker', 'backend/profiadmin/960'));
?>

<script language="javascript">
    $(document).ready(function() {
        $('#add').click(function() {
            return !$('#MeetNhanVien option:selected').remove().appendTo('#StaffStaff');
        });

        $('#remove').click(function() {
            return !$('#StaffStaff option:selected').remove();
        });
    });                 
</script>
<div class="meets form">

    <?php echo $this->Form->create('Meet'); ?>
    <fieldset>
        <legend><?php __('Thông tin cuộc họp'); ?></legend>
        <div>
            <?php echo $this->Form->input('meet_name', array('label' => 'Tên cuộc họp:')); ?>
            </br>
            <?php echo $this->Form->input('descriptione', array('label' => 'Mô tả:', 'type' => 'textarea')); ?>
            </br>
            <?php echo $this->Form->input('quanlity', array('label' => 'Số lượng người dự:')); ?>
            </br>
            <?php echo $this->Form->input('room_id', array('label' => 'Phòng họp:')); ?>
            </br>
            <?php echo $datePicker->picker('date_register', array('label' => 'Thời gian đăng ký:')); ?>
            </br>
            <?php echo $datePicker->picker('date_meet', array('label' => 'Ngày họp:')); ?>  
            </br>
            <div id="wrapper" class="container_10">
                <div id="first" class="grid_3">
                    <?php echo $this->Form->input('time_start', array('label' => 'Thời gian bắt đầu:', 'type' => 'time', 'timeFormat' => '24')); ?>                
                </div>
                <div id="second" class="grid_3">
                    <?php echo $this->Form->input('time_stop', array('label' => 'Thời gian kết thúc:', 'type' => 'time', 'timeFormat' => '24')); ?>
                </div>
                <div id="third" class="grid_3">
                    <?php echo $this->Form->input('time_alert', array('label' => 'Thời gian thông báo :', 'type' => 'time', 'timeFormat' => '24')); ?>
                </div>  
            </div>
        </div>
    </fieldset>
    <fieldset>
        <legend><?php __('Danh sách nhân viên'); ?></legend>
        <?php
        echo $this->Form->input('department_id', array(''));
        ?>
        <div id="add">
            <div id="select1">
                <div id="select1_nv1">
                <?php
                echo $this->Form->input('Nhan_vien', array(
                    'label' => __('Nhân viên được chọn:', true),
                    'type' => 'select',
                    'multiple' => 'multiple',
                    'options' => $tests
                ));
                $options = array('url' => 'getStaffs', 'update' => 'MeetNhanVien');
                echo $ajax->observeField('MeetDepartmentId', $options);
                ?>
                </div>
                <a href="#" id="add">add &gt;&gt;</a>        
            </div>
            <div id="select2"> 
                <div id="select2_nv2"> 
                <?php
                echo $this->Form->input('Staff', array(
                    'label' => __('Nhân viên được chọn:', true),
                    'type' => 'select',
                    'multiple' => 'multiple',
                    'options' => $staffs,
                    'selected' => $html->value('Staff.Staff')
                ));
                ?>
                </div>
                <a href="#" id="remove">&lt;&lt; remove</a> 
            </div>
        </div>
    </fieldset>

    <fieldset>
        <legend><?php __('Chọn thiết bị'); ?></legend>
        <?php
        echo $this->Form->input('Device', array(
            'label' => __('', true),
            'type' => 'select',
            'multiple' => 'checkbox',
            'options' => $devices,
            'selected' => $html->value('Device.Device'),
        ));
        ?>
    </fieldset>

    <?php echo $this->Form->end(__('Submit', true)); ?>
</div>
<div class="actions">
    <h3><?php __('Actions'); ?></h3>
    <ul>

        <li><?php echo $this->Html->link(__('List Meets', true), array('action' => 'index')); ?></li>
        <li><?php echo $this->Html->link(__('List Rooms', true), array('controller' => 'rooms', 'action' => 'index')); ?> </li>
        <li><?php echo $this->Html->link(__('New Room', true), array('controller' => 'rooms', 'action' => 'add')); ?> </li>
        <li><?php echo $this->Html->link(__('List Devices', true), array('controller' => 'devices', 'action' => 'index')); ?> </li>
        <li><?php echo $this->Html->link(__('New Device', true), array('controller' => 'devices', 'action' => 'add')); ?> </li>
        <li><?php echo $this->Html->link(__('List Staffs', true), array('controller' => 'staffs', 'action' => 'index')); ?> </li>
        <li><?php echo $this->Html->link(__('New Staff', true), array('controller' => 'staffs', 'action' => 'add')); ?> </li>
    </ul>
</div>